package com.example.springbootgraduation.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

//用户模块
@TableName("user")
@Data
public class User {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    private String username;
    private String password;
    private String salt;//用于加密

    private String sex;
    private Integer age;
    private String address;
    private String img;//头像
    private String phone;
    private String card;

    /*实际上作为外键使用*/
    private Integer banJiId;
    private Integer xueYuanId;
    private Integer teacherId;

    /*如果不加以下三个,那么MybatisPlus会报错*/
    /*非数据库列 班级名字*/
    @TableField(exist = false)
    private String banJiName;

    /*非数据库列 学院名字*/
    @TableField(exist = false)
    private String xueYuanName;

    /*非数据库列 老师名字*/
    @TableField(exist = false)
    private String teacherName;

}
